package com.myacg.core.dao.base;

import com.myacg.core.dao.service.RecordService;

/**
 * 通用的DB操作類 對RecordService.java進行再封裝
 * @author guoshichang
 */
public class CommonEntityJsonDB{
	
	Class entityClass;
	private  RecordService recordService;
	public   CommonEntityJsonDB(Class entityClass){
			this.entityClass =entityClass; 
			EntityTable entityTable = EntityTableJsonDB.getInstance().getEntityTable(this.entityClass);
			String realDBPath=EntityTableJsonDB.getInstance().getRealDBPath(entityTable.getDbFilePath());
		    this.recordService = new RecordService(entityClass, realDBPath);
	}
	
	public Class getEntityClass(){
		return entityClass;
	}
	/**
	 * 数据库IO服务RecordService 提供实体对象的增删改查
	 * @return
	 */
	public RecordService getRecordService() {
		return recordService;
	}
}
